<!doctype html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>boss</title>
    <!-- Bootstrap -->
    <link th:insert="common/head :: commonheader">
    <link rel="stylesheet" th:href="@{/css/worker.css}">
    <link rel="stylesheet" th:href="@{/css/employInfo.css}">
    <script type="text/javascript" src="https://api.map.baidu.com/api?v=1.0&&type=webgl&ak=yTVAbw4Nv78bYsi0PiPbbXt8VD8V6RYp"></script>
</head>
<!--<body class="login-body">-->

<body style="background-color: #F5F6FA">
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div th:insert="common/head :: header">
            </div>
            </div>
        </div>
    </div>


    <div class="container">
        <!-- body -->
        <div class="row" >
            <div class="first_base col-md-12">
                    <div class="col-md-12" style="background-color: #fff;">
                        <div class="row col-md-12">
                            <h3 th:text="${work.getTitle()}">广州黄埔区职位描述: 1、及时接收、准时配送外卖订单;2、骑手安全,...</h3>
                            <span class="text_df" style="display: inline-block; margin-left: 20px;" ><b>发布时间:</b></span>
                            <span class="text_df" style="display: inline-block; margin-left: 20px;" th:text="${work.getPublishTime().substring(0,work.getPublishTime().length()-2)}">2022-4-8 15:50</span>
                        </div>
                        <div class="col-md-12 first_base ">
                            <div class="col-md-1 first_base_one " style="padding-left: 16px; "><span class="text_df"> <b> 联系人 :</b></span></div>
                            <div class="col-md-11 first_base_two ">
                                <div>
                                    <span class=" " style="padding-left: 5px;" th:text="${work.getUser().getRealName()}">张女士</span>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 first_base ">
                            <div class="col-md-1 first_base_one " style="padding-left: 2px; "><span class="text_df"> <b> 项目地址 :</b></span></div>
                            <div class="col-md-11 first_base_two ">
                                <div style="padding-left: 7px; ">
                                    <span class=" " id="address" th:text="${work.getAddress()}">广东广州黄浦区张三栋工业区</span>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 first_base ">
                            <div class="col-md-1 first_base_one " style="padding-left: 2px; ">
                                <span class="text_df " > <b> 所需工种 :</b></span></div>
                            <div class="col-md-11 first_base_two ">
                                <div style="padding-left: 7px; ">
                                    <span class=" " th:text="${work.getTrade()}">【外卖骑手】</span>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 first_base ">
                            <div class="col-md-1 first_base_one " style="padding-left: 2px; ">
                                <span class="text_df " > <b> 所需对象 :</b></span></div>
                            <div class="col-md-11 first_base_two ">
                                <div style="padding-left: 7px; ">
                                    <span class="text-primary well sp_well" th:if="${work.getObject()}==0">兼职</span>
                                    <span class="text-primary well sp_well" th:if="${work.getObject()}==1">长期工</span>
                                    <span class="text-primary well sp_well" th:if="${work.getObject()}==2">高级工</span>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-12 first_base ">
                            <div class="col-md-1 first_base_one " style="padding-left: 2px; "><span class="text_df "> <b> 联系电话 :</b></span></div>
                            <div class="col-md-11 first_base_two ">
                                <div style="padding-left: 7px; ">
                                    <span class="well well_padding " th:text="${work.getUser().getPhone().substring(0,work.getUser().getPhone().length()-4)}+'****'" style="width: 120px;height: 30px;font-size: large" id="phone">1649846****</span>
                                    <input type="hidden" id="realName" th:value="${session.user?.getRealName()}">
                                    <input type="hidden" id="realPhone" th:if="${session.user?.getRealName()}" th:value="${work.getUser().getPhone()}">
                                    <a class="btn btn-primary" th:if="${work.getState()==0}" id="call">立即联系</a>
                                    <a class="btn btn-danger" th:if="${work.getState()==1}">已招满</a>
                                </div>
                            </div>
                        </div>

                    </div>
                <div class="col-md-12 " style="background-color: #ffffff; margin-top: 10px; margin-bottom: 0px;">
                    <h4 style="font-weight: 800; ">招工详情</h4>
                    <div class="zw_js ">
                        <span class="text_df"><b>职位描述:</b></span>
                        <div style="margin-left: 2em;" >
                            <p th:text="${work.getWorkDescribe()}">1、及时接收、准时配送外卖订单；</p>
                        </div>
                        <span class="text_df"><b>招工标签:</b></span>
                        <span class="text-primary well sp_well" th:text="${work.getTrade()}"></span>
                    </div>
                </div>

                <div class="col-md-12 " style="background-color: #ffffff; margin-top: 10px; margin-bottom: 0px; padding-bottom: 10px;">
                    <h4 style="font-weight: 800; ">招工地址</h4>
                    <div class="container" id="aaaa" style="height: 300px;width: 100%;"></div>
                </div>

                <div class="col-md-12 " style="background-color: #ffffff; margin-top: 10px; margin-bottom: 10px; padding-bottom: 10px;">
                    <h4>为你推荐</h4>
                    <div class="col-md-4 column box-box" th:each="work:${recommend}">
                        <a href="" style="text-decoration: none" th:href="@{'/toBoss/' + ${work.getId()}}">
                            <div class="box-work" >
                                <p><span th:text="${work.getTitle().length()<14?work.getTitle():work.getTitle().substring(0,14)+'...'}"></span><span class="glyphicon glyphicon-fire" th:text="${work.getState()==0?'正在招':'已招满'}"></span></p>
                                <p th:text="${work.getPublishTime()}"></p>
                                <p th:text="${work.getWorkDescribe().length()<50?work.getWorkDescribe():work.getWorkDescribe().substring(0,50)}+'...'" style="height: 50px;"></p>
                                <div>
                                    <img th:src="@{/images/42.jpg}" style="width: 40px; height: 40px;" alt="">
                                    <span>张三</span>
                                </div>
                            </div>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <!-- body -->

        <footer class="col-md-12" style="padding: 0px;" th:insert="common/head :: footer">
        </footer>
    </div>

    <script type="text/javascript">

        let address = $('#address').text();
        var map = new BMapGL.Map("aaaa");
        // 创建地图实例
        // var point = new BMapGL.Point(116.404, 39.915);
        // 创建点坐标
        map.centerAndZoom("广州",12);
        // 初始化地图，设置中心点坐标和地图级别
        var marker = new BMapGL.Marker(new BMapGL.Point(116.404, 39.915));

        map.enableScrollWheelZoom(true);

        function addOverlay() {
            map.addOverlay(marker); // 增加点
        }

        function removeOverlay() {
            map.clearOverlays();
        }
        addOverlay();
        map.clearOverlays();    //清除地图上所有覆盖物
        var local = new BMapGL.LocalSearch(map, {
            renderOptions:{map: map},
            pageCapacity: 1,
        });
        local.search(address);

        let realName = document.getElementById('realName').value;
        let call = document.getElementById('call');
        call.onclick = function (){
            if (realName===null||realName===''){
                alert("账号未实名,请先完成验证");
                window.location.href = '/user/getEmployeeWork';

            }else {
                document.getElementById('phone').textContent=document.getElementById('realPhone').value;
            }
        }

    </script>




</body>
</html>
